const mongoose = require('./db')
var Schema = mongoose.Schema

const chatshopsSchema = new Schema({
    name: String,
    avatar: String,
})
const chatagentsSchema = new Schema({
    name: String,
    password: String,
    avatar: String,
    email: String,
    phone: String,
    shop_id: {
        type: mongoose.Types.ObjectId,
        ref: "chatshop"
    }
})

const chatshopModel = mongoose.model('chatshop', chatshopsSchema, 'chatshop')
const chatagentsModel = mongoose.model('chatagents', chatagentsSchema, 'chatagents')

// chatshopModel.create([
//     {
//         name: 'GoEasy食品自营',
//         avatar: '/static/images/shop1.png',
//     },
//     {
//         name: 'GoEasy家具生活自营',
//         avatar: '/static/images/shop2.png',
//     },
//     {
//         name: 'GoEasy电器自营',
//         avatar: '/static/images/shop3.png'
//     },
//     {
//         name: '米忽悠',
//         avatar: '/static/images/shop3.png',
//     },
// ])
// chatagentsModel.create([
//     {
//         name: '银狼',
//         password: '1234',
//         avatar: '/static/avater/yl.png',
//         email: 'yinlang@goeasy.io',
//         phone: '15106998957',
//         shop_id: "649b96fce2c0622eb2674df2"
//     },
//     {
//         name: 'type-c符玄',
//         password: '123',
//         avatar: '/static/avater/fx.jpg',
//         email: 'Harry@goeasy.io',
//         phone: '138xxxxxxxx',
//         shop_id: "649b96fce2c0622eb2674def"
//     },
//     {
//         name: '镜流',
//         password: '123',
//         avatar: '/static/avater/jl.jpg',
//         email: 'Belle@goeasy.io',
//         phone: '138xxxxxxxx',
//         shop_id: '649b96fce2c0622eb2674df0'
//     }
// ])

module.exports = { chatshopModel, chatagentsModel }